﻿using System.Text;
using pub.Interop;

namespace pub.Functions
{
    public class PathFuncs
    {
        public static string CompactPath(string path, int maxLength)
        {
            if (path.Length <= maxLength)
            {
                return path;
            }
            var sb = new StringBuilder(maxLength + 1);
            Win32.PathCompactPathEx(sb, path, maxLength + 1, 0);
            return sb.ToString();
        }
    }
}